package com.qst.service;

import com.qst.dao.IEmployeeDao;
import com.qst.dao.MeetingDao;
import com.qst.pojo.Employee;
import com.qst.pojo.Meeting;
import com.qst.pojo.MeetingRoom;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author KungSu.
 * @create 2021-06-24 10:55
 */
@Service
public class NotificationsDetilService {
    @Autowired
    private MeetingDao meetingDao;
    @Autowired
    private IEmployeeDao iEmployeeDao;
    public Meeting findThisMeeting(Integer meetingid,Integer roomid){
        Meeting meeting = new Meeting();
        meeting.setMeetingid(meetingid);
        meeting.setMeetingRoom(new MeetingRoom(roomid));
        Meeting m = meetingDao.findThisMeeting(meeting);
        m.getMeetingRoom().setRoomID(roomid);
        return m;
    }
    public String findOrderPerson(Integer employeeid){
        return meetingDao.findOrderPerson(employeeid);
    }
    public List<Employee> findEmployee(Integer meetingid){
        List<Employee> employees = iEmployeeDao.findEmployee(meetingid);
        return employees;
    }
    public void delMeetingEmployeeByMeetingId(Integer meetingid,Integer employeeid){
        meetingDao.delMeetingEmployeeByMeetingId(meetingid,employeeid);
    }
}
